package edu.pku.sei.transformation.editor.views.figures;

import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.GridLayout;
import org.eclipse.draw2d.GroupBoxBorder;
import org.eclipse.draw2d.LineBorder;
import org.eclipse.draw2d.ToolbarLayout;

public class ClauseFigure extends Figure {
	private Figure whenArea;
	private Figure whereArea;

	public ClauseFigure() {
		GridLayout layout = new GridLayout();
		// layout.numColumns = 1;
		this.setLayoutManager(layout);
		this.setBorder(new LineBorder(ColorConstants.buttonDarker, 1));

		whenArea = new Figure();
		ToolbarLayout whenLayout = new ToolbarLayout();
		whenLayout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
		whenLayout.setStretchMinorAxis(false);
		whenArea.setLayoutManager(whenLayout);
		GroupBoxBorder whenBorder = new GroupBoxBorder();
		whenBorder.setLabel("when");
		whenBorder.setFont(FontConstant.ARIAL_12_B);
		whenArea.setBorder(whenBorder);
		this.add(whenArea);

		whereArea = new Figure();
		ToolbarLayout whereLayout = new ToolbarLayout();
		whereLayout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
		whereLayout.setStretchMinorAxis(false);
		whereArea.setLayoutManager(whereLayout);
		GroupBoxBorder whereBorder = new GroupBoxBorder();
		whereBorder.setLabel("where");
		whereBorder.setFont(FontConstant.ARIAL_12_B);
		whereArea.setBorder(whereBorder);
		this.add(whereArea);
	}
}
